package com.dks.controller;


import com.dks.repository.IPosterRepository;
import com.dks.result.Result;
import com.dks.result.ResultInfo;
import com.dks.result.ResultModel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("poster")
@RestController
public class PosterController{

    private IPosterRepository posterRepository;

    @Autowired
    public PosterController(final IPosterRepository posterRepositoryIn){
        this.posterRepository = posterRepositoryIn;
    }

    /**
     * @Author: Ah Nan
     * @Description: 获取系统全部的邀请海报图片列表
     * @Date: 9:52 2020/4/23
     * @Modificd By:
     * @Param: parentId 家长id
     * @Param: pageNum 页码
     * @Param: pageSize 条数
     * @return:
     * @throw: 请描述异常信息
     */
    @GetMapping("get-poster-list")
    public ResultModel<Object> getPosterList( Integer pageNum, Integer pageSize) {

        if (null == pageNum) {
            return Result.makeResult(ResultInfo.ERR_PARAM_NULL, "pageNum");
        }
        if (null == pageSize) {
            return Result.makeResult(ResultInfo.ERR_PARAM_NULL, "pageSize");
        }
        return posterRepository.getPosterList(pageNum,pageSize);
    }
}
